package com.example.test6;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class secondActicity extends Activity {

	private Intent intent;
	private Bundle bunde;
	protected void onCreate(Bundle savedInstanceState){
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_second);
		Bundle bunde=this.getIntent().getExtras();
		String ans=bunde.getString("ans");
		String tx="asd";
		if(ans.equals("four")){
			tx="right";
		}
		else{
			tx="error";
		}
		TextView tv1=(TextView)findViewById(R.id.text1);
		tv1.setText("you choose:"+tx);
		Button btn3_back=(Button)findViewById(R.id.button_back);
		btn3_back.setOnClickListener(new OnClickListener(){
			public void onClick(View v){
				secondActicity.this.setResult(RESULT_OK,intent);
				secondActicity.this.finish();
			}
		});
	}


}
